<?php
/**
 * Created by PhpStorm.
 * User: fire
 * Date: 2018/10/19
 * Time: 11:12
 */

namespace App\Inspections;


class InvalidKeywords
{
    protected $keywords =[
        'something forbidden'
    ];

    public function detect($body)
    {
        foreach ($this->keywords as $invalidKeyword){
            if(stripos($body,$invalidKeyword) !== false){
                throw new \Exception('Your reply contains spam.');
            }
        }
    }

}